package edu.sctu.jarime.june.day20150609;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * Created by user19 on 2015/6/9.
 */
public class CountTime {
    public static void main(String[] args) {

        CountTime countTime=new CountTime();
        countTime.countTime();
    }


    private void countTime(){
        Date date = new Date();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String timein= simpleDateFormat.format(date);
        System.out.println("进站时间："+timein);

        Date time=null;
        try {
            time=simpleDateFormat.parse(timein);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(time);
        calendar.add(Calendar.MINUTE,2);
        time=calendar.getTime();
        String timeout=simpleDateFormat.format(time);
        System.out.println("出站时间："+timeout);




    }
}
